package maple.thelittleredbook.content.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Param;
import maple.thelittleredbook.content.entity.Video;

import java.util.List;

/**
 * 视频Mapper接口
 */
@Mapper
public interface VideoMapper extends BaseMapper<Video> {

    /**
     * 根据内容ID查询视频列表
     */
    @Select("SELECT id, content_id, video_url, created_at FROM videos WHERE content_id = #{contentId} ORDER BY created_at ASC")
    List<Video> selectByContentId(@Param("contentId") Long contentId);
}